import { http } from '@/utils/http/axios';
const baseUrl = '/iop-resourcelib-service';
const systemUrl = '/iop-system-service';
const resourcelib = '/iop-resourcelib';
/**
 * 获取到期提醒
 */
export function queryReminder() {
	return http.request({
		url: `/iop-resourcelib-service/reminder/reminderAfterLogin/${new Date().getTime()}`,
		method: 'GET',
	});
}
/**
 * 查询菜单列表
 */
export function queryMenu() {
	return http.request({
		url: `/iop-system-service/common/queryMenu?operationId=180000`,
		method: 'GET',
	});
}

/**
 * 查询登录信息（对接综合运营平台）
 */
export function queryLoginInfo() {
	return http.request({
		url: `/iop-resourcelib-service/sso/queryLoginInfo`,
		method: 'GET',
	});
}
/**
 * 查询资源列表
 */
export function queryResourceList(params) {
	return http.request({
		url: `${baseUrl}/resource/queryResourceList`,
		method: 'POST',
		params,
	});
}

export function login(params) {
	return http.request({
		url: `${systemUrl}/sso/login`,
		method: 'POST',
		params,
	});
}
export function importPublishResource(params) {
	return http.request(
		{
			url: `${baseUrl}/resource/importPublishResource`,
			method: 'POST',
			params,
		},
		{ isShowMessage: true, successMessageText: '导入成功' }
	);
}
export function importOriginalResource(params) {
	return http.request(
		{
			url: `${baseUrl}/resource/importOriginalResource`,
			method: 'POST',
			params,
		},
		{ isShowMessage: true, successMessageText: '导入成功' }
	);
}
export function batchImportPublishingResourceFile(params) {
	return http.request(
		{
			url: `${baseUrl}/resource/batchImportPublishingResourceFile`,
			method: 'POST',
			params,
		},
		{ isShowMessage: true, successMessageText: '导入成功' }
	);
}
export function addTemporaryShelf(params) {
	return http.request(
		{
			url: `${baseUrl}/resourceTemporaryShelf/addTemporaryShelf`,
			method: 'POST',
			params,
		},
		{ isShowMessage: true, successMessageText: '添加成功' }
	);
}

export function getOverview() {
	return http.request({
		url: `${resourcelib}/statistics/overview`,
		method: 'GET',
	});
}

export function getTypeNumStatistics() {
	return http.request({
		url: `${resourcelib}/statistics/res`,
		method: 'GET',
	});
}
export function getCopyrightTypeStatistics() {
	return http.request({
		url: `${resourcelib}/statistics/copyright/type`,
		method: 'GET',
	});
}
export function getCopyrightAuthScopeStatistics() {
	return http.request({
		url: `${resourcelib}/statistics/copyright/authScope`,
		method: 'GET',
	});
}
